<div class="form-container">
  <form nz-form [formGroup]="form" (ngSubmit)="onSubmit(form, $event)">
    <nz-form-item>
      <nz-form-label nzRequired>入库单号</nz-form-label>
      <nz-form-control nzHasFeedback [nzErrorTip]="'入库单号不能为空！'">
        <input nz-input formControlName="inNum" placeholder="请输入入库单号" name="inNum" />
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label>总价</nz-form-label>
      <nz-form-control>
        <nz-input-number [nzDisabled]="true" formControlName="totalPrice" [nzMin]="0" [nzStep]="1"></nz-input-number>
      </nz-form-control>
    </nz-form-item>
    <!-- 子组件作为表单控件加入到formGroup的表单验证中，具体实现在对应组件中 -->
    <app-material-in-item formControlName="materials" [(materials)]="materailIn.materials" [totalPrice]="materailIn.totalPrice" (totalPriceChange)="setTotalPrice($event)"></app-material-in-item>
    <button type="submit" nz-button [nzType]="'primary'">提交</button>
  </form>
</div>